import { createRouter, createWebHistory } from "vue-router";
// import Home from "../views/Home.vue";
import image from "../views/image/Image.vue"

const routes = [
  {
    path: "/",
    name: "index",
    component: image,
  },
  {
    path: "/image",
    name: "image",
    component: image,
  },
  {
    path: "/batchCreate",
    name: "batchCreate",
    component: () => import(`../views/image/batchCreate/batchCreateIndex.vue`),
  },
  {
    path: "/addTask",
    name: "batchCreate/addTask",
    // @ts-ignore
    component: () => import(`../views/image/batchCreate/addTask.vue`),
  },
  {
    path: "/checkTask",
    name: "batchCreate/checkTask",
    // @ts-ignore
    component: () => import(`../views/image/batchCreate/checkTask.vue`),
  },

  {
    path: "/account",
    name: "account",
    // @ts-ignore
    component: () => import(`../views/me/account.vue`),
  },
  {
    path: "/peggRecharge",
    name: "account/peggRecharge",
    // @ts-ignore
    component: () => import(`../views/me/peggRecharge.vue`),
  },
  {
    path: "/test",
    name: "test",
    // @ts-ignore
    component: () => import(`../views/test.vue`),
  },


];

const router = createRouter({
  history: createWebHistory(),
  routes,
  scrollBehavior(to: any, from: any, savedPosition: any) {
    if (savedPosition) {
      return savedPosition;
    } else {
      return { top: 0 };
    }
  },
});

export default router;